<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>computed计算属性</title>
    <script src="./js/vue.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model:value="message">
    {{message}}
    <p>方法每次调用都会更新{{currentTime1()}}</p>
    <p>监听属性，属性修改更新{{currentTime2}}</p>
</div>

<script>
    var vm = new Vue({
        el : "#app",
        data:{
            message : "kkk"
        },
        methods: {
            currentTime1: function () {
                return Date.now();
            }
        },
        computed:{
            currentTime2: function (){
                this.message;
                return Date.now();
            }
        }
    });
</script>
</body>
</html>